<?php 
//print_r($HttpResult);
if(1==2){$HttpResult = new HttpResult();}
	
	  $HttpContentResult = $HttpResult->getHttpContentResult();
//	  Debug::print_r($HttpResult);
	  //$lang = Config::DEFAULT_LOCALE;
		$head = new HtmlHeader($HttpContentResult->getHeader());
		$head->addCSS('reset');
		$head->addCSS('print','', 'print');
		$head->addCSS('ie',  'css/ie', 'print',true);
		
		$head->addCSS('forum',"css/admin");		
		
		//<!-- PROGRAMACAO JS | JQUERY  -->
		$head->addJS(array('jquery', 'masked'));
		
	    //MENU DROPDOWN
	    $head->addJS('Menu principal','js/menu/ddsmoothmenu');
	    $head->addCSS('Menu CSS','js/menu/ddsmoothmenu');
	    
	    //TINYMCE
	    $head->addJS('tinymce','js/tinymce/jquery.tinymce');
	  	
		//<!-- JQUERY UI  -->
		$head->addJS('UI', 'js/UI/js/jquery-ui-1.8.6.custom.min');
		$head->addCSS('UI','js/UI/css/smoothness/jquery-ui-1.8.6.custom');

		//<!-- VTIP  -->
		$head->addJS('vtip', 'js/vtip/vtip');
		$head->addCSS('vtip', 'js/vtip/vtip');
		
		//<!-- TABLE SORTER -->
		$head->addJS('tablesorter', 'js/tablesorter/tablesorter');
		$head->addCSS('tablesorter', 'js/tablesorter/tablesorter');
		

    //<!-- PROGRAMACAO JS | JQUERY  -->
//    $head->addJS(array('utils/validation', '/admin/user/insert', 'admin_select','admin'));
    $head->addJS(array('utils/validation', 'admin/user/insert', 'admin_select','admin'));
    
		$header_html = $head->show(TRUE);
$header_html = str_replace(array("democrart", "democrArt", "Democrart", "DemocrArt"), array("expressaoartistica", "Expressão Artística", "Expressão Artística", "Expressão Artística"), $header_html);
echo $header_html;
?>
 
<body>

<div id="main">
     <?php include Config::getFolderView("parts/admin/header.php"); ?>
      
	  <div id="main_content">
	  
	  <div id="msgBox">
			<?php 
			
					//se for setado o return_result_vo ele pega a array de messages e exibe, independende se Ã© erro ou sucesso
					if(isset($HttpContentResult->return_result_vo) && count($HttpContentResult->return_result_vo->array_messages) > 0){
				    	foreach($HttpContentResult->return_result_vo->array_messages as $system_message){
			//	    		$system_message = $formData->translateMessage($system_message);
							?>
							<p class="success"><?php echo $system_message; ?></p>
							<?php
				    	}
				    }
			?>	  
	  </div>
	  			
		 <div id="box_right">
			<h1>Inserir Cupom</h1>
			
			<div style="clear:both">
			<form name="frmCadastro" id="frmCadastro" class="frm" method="post" action="<?php echo Config::getRootPath("admin/coupon/insert"); ?>">
		
				<ul>
					<li class="separador">DADOS DO CUPOM</li>
					
					<li>
						<label for="token">Token:</label>
						<input type="text" size="40" name="token" id="token" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "token"); ?>"/><label class="info">*</label>
					</li>
					<li>
						<label for="type">Token é Obrigatorio?</label>
						<select name="token_is_obrigatory" id="token_is_obrigatory">
							<option value="1" <?php echo (DataHandler::getValueByArrayIndex($_POST, "token_is_obrigatory")== "1")?"selected='selceted'":""; ?>>Sim</option>
							<option value="0" <?php echo (DataHandler::getValueByArrayIndex($_POST, "token_is_obrigatory")== "0")?"selected='selceted'":""; ?>>Não</option>
						</select>
					</li>					
					<li>
						<label for="title">Titulo:</label>
						<input type="text" size="40" name="title" id="title" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "title"); ?>"/><label class="info">*</label>
					</li>
					<li>
						<label for="description">Descrição:</label>
						<textarea size="40" name="description" id="description"><?php echo DataHandler::getValueByArrayIndex($_POST, "description"); ?></textarea><label class="info"></label>
					</li>
					<li>
						<label for="type">Tipo:</label>
						<select name="type" id="type">
							<option value="*" <?php echo (DataHandler::getValueByArrayIndex($_POST, "type")== "*")?"selected='selceted'":""; ?>>Porcentagem</option>
							<option value="-" <?php echo (DataHandler::getValueByArrayIndex($_POST, "type")== "-")?"selected='selceted'":""; ?>>Subtração</option>
<!-- 							<option value="+" <?php echo (DataHandler::getValueByArrayIndex($_POST, "type")== "+")?"selected='selceted'":""; ?>>Adição</option> -->
						</select>
					</li>

					<li>
						<label for="token">Valor:</label>
						<input type="text" size="10" name="value" id="value" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "value"); ?>"/><label class="info">*</label>
					</li>

					<li>
						<label for="token">Valor Minimo Para Validar o Cupom:</label>
						<input type="text" size="10" name="minimum_value" id="minimum_value" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "minimum_value"); ?>"/><label class="info">* Coloque 0 ( zero ) para desabilitar valor minimo </label>
					</li>

					<li>
						<label for="token">Quantidade Minima de Produtos Para Validar o Cupom:</label>
						<input type="text" size="10" name="minimum_product_quantity" id="minimum_product_quantity" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "minimum_product_quantity"); ?>"/><label class="info">* Coloque 0 ( zero ) para desabilitar quantidade minima </label>
					</li>

					<li>
						<label for="type">Quantidade é Inifnita?</label>
						<select name="is_infinity" id="is_infinity" style="float: left">
							<option value="0" <?php echo (DataHandler::getValueByArrayIndex($_POST, "is_infinity")== "0")?"selected='selceted'":""; ?>>Não</option>
							<option value="1" <?php echo (DataHandler::getValueByArrayIndex($_POST, "is_infinity")== "1")?"selected='selceted'":""; ?>>Sim</option>
						</select>
						<label class="info">* Se a quantidade for infinita os valores de Quantiade Inicial e Quantidade não são Obrigatórios</label>
					</li>		

					<li>
						<label for="token">Quantidade Inicial:</label>
						<input type="text" size="10" name="quantity_ref" id="quantity_ref" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "quantity_ref"); ?>"/><label class="info">* Apenas para referência de quantas vandas serão</label>
					</li>

					<li>
						<label for="token">Quantidade:</label>
						<input type="text" size="10" name="quantity" id="quantity" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "quantity"); ?>"/><label class="info">* Quantidade de Cupons que será diminuida automaticamente conforme as vendas</label>
					</li>

					<li>
						<label for="date_in">Data Inicio:</label>
						<input type="text" size="40" name="date_in" id="date_in" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "date_in"); ?>"/><label class="info">*</label>
					</li>
					<li>
						<label for="date_out">Data Termino:</label>
						<input type="text" size="40" name="date_out" id="date_out" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "date_out"); ?>"/><label class="info">*</label>
					</li>
					<li>
						<input type="submit" value="Enviar" id="enviar" class="btEnviar" />
					</li>
					
				</ul>
				
			</form>

			</div>
		
		</div>
					
			
			<!-- FIM DO QUADRO -->
	
	</div>
	
</div>

</body>
</html>
